package io.jpress.service;

import com.jfinal.plugin.activerecord.Page;
import io.jpress.model.ZzRole;

import java.util.List;

public interface ZzRoleService  {

    /**
     * find model by primary key
     *
     * @param id
     * @return
     */
    public ZzRole findById(Object id);


    /**
     * find all model
     *
     * @return all <ZzRole
     */
    public List<ZzRole> findAll();


    /**
     * delete model by primary key
     *
     * @param id
     * @return success
     */
    public boolean deleteById(Object id);


    /**
     * delete model
     *
     * @param model
     * @return
     */
    public boolean delete(ZzRole model);


    /**
     * save model to database
     *
     * @param model
     * @return  id value if save success
     */
    public Object save(ZzRole model);


    /**
     * save or update model
     *
     * @param model
     * @return id value if saveOrUpdate success
     */
    public Object saveOrUpdate(ZzRole model);


    /**
     * update data model
     *
     * @param model
     * @return
     */
    public boolean update(ZzRole model);


    /**
     * paginate query
     *
     * @param page
     * @param pageSize
     * @return
     */
    public Page<ZzRole> paginate(int page, int pageSize);

   public  boolean  doChangeRoleByIds(Long roleId, Object[] toArray);

   public String getRoleByUserId(Object user_id);

   public ZzRole getZzRolebyUserID(Object user_id);


}